<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QStyleOptionToolButton Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QStyleOptionToolButton Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QStyleOptionToolButton class is used to describe the
parameters for drawing a tool button. <a href="#details">More...</a></p>

<p>Inherits <a href="qstyleoptioncomplex.html">QStyleOptionComplex</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qstyleoptiontoolbutton.html#StyleOptionType-enum">StyleOptionType</a></b> { Type }</li><li><div class="fn" />enum <b><a href="qstyleoptiontoolbutton.html#StyleOptionVersion-enum">StyleOptionVersion</a></b> { Version }</li><li><div class="fn" />enum <b><a href="qstyleoptiontoolbutton.html#ToolButtonFeature-enum">ToolButtonFeature</a></b> { None, Arrow, Menu, PopupDelay, MenuButtonPopup, HasMenu }</li><li><div class="fn" />class <b><a href="qstyleoptiontoolbutton-toolbuttonfeatures.html">ToolButtonFeatures</a></b></li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qstyleoptiontoolbutton.html#QStyleOptionToolButton">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qstyleoptiontoolbutton.html#QStyleOptionToolButton-2">__init__</a></b> (<i>self</i>, QStyleOptionToolButton&#160;<i>other</i>)</li></ul><h3>Members</h3><ul><li><div class="fn" />Qt.ArrowType <b><a href="qstyleoptiontoolbutton.html#arrowType-var">arrowType</a></b></li><li><div class="fn" />ToolButtonFeatures <b><a href="qstyleoptiontoolbutton.html#features-var">features</a></b></li><li><div class="fn" />QFont <b><a href="qstyleoptiontoolbutton.html#font-var">font</a></b></li><li><div class="fn" />QIcon <b><a href="qstyleoptiontoolbutton.html#icon-var">icon</a></b></li><li><div class="fn" />QSize <b><a href="qstyleoptiontoolbutton.html#iconSize-var">iconSize</a></b></li><li><div class="fn" />QPoint <b><a href="qstyleoptiontoolbutton.html#pos-var">pos</a></b></li><li><div class="fn" />QString <b><a href="qstyleoptiontoolbutton.html#text-var">text</a></b></li><li><div class="fn" />Qt.ToolButtonStyle <b><a href="qstyleoptiontoolbutton.html#toolButtonStyle-var">toolButtonStyle</a></b></li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QStyleOptionToolButton class is used to describe the
parameters for drawing a tool button.</p>
<p>QStyleOptionToolButton contains all the information that
<a href="qstyle.html">QStyle</a> functions need to draw <a href="qtoolbutton.html">QToolButton</a>.</p>
<p>For performance reasons, the access to the member variables is
direct (i.e., using the <tt>.</tt> or <tt>-&gt;</tt> operator).
This low-level feel makes the structures straightforward to use and
emphasizes that these are simply parameters used by the style
functions.</p>
<p>For an example demonstrating how style options can be used, see
the <a href="widgets-styles.html">Styles</a> example.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="StyleOptionType-enum" />QStyleOptionToolButton.StyleOptionType</h3><p>This enum is used to hold information about the type of the
style option, and is defined for each <a href="qstyleoption.html">QStyleOption</a> subclass.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionToolButton.Type</tt></td>
<td class="topAlign"><tt>SO_ToolButton</tt></td>
<td class="topAlign">The type of style option provided (<a href="qstyleoption.html#OptionType-enum">SO_ToolButton</a> for this
class).</td>
</tr>
</table>
<p>The type is used internally by <a href="qstyleoption.html">QStyleOption</a>, its subclasses, and <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>() to
determine the type of style option. In general you do not need to
worry about this unless you want to create your own <a href="qstyleoption.html">QStyleOption</a> subclass and your own
styles.</p>
<p><b>See also</b> <a href="qstyleoptiontoolbutton.html#StyleOptionVersion-enum">StyleOptionVersion</a>.</p>


<h3 class="fn"><a name="StyleOptionVersion-enum" />QStyleOptionToolButton.StyleOptionVersion</h3><p>This enum is used to hold information about the version of the
style option, and is defined for each <a href="qstyleoption.html">QStyleOption</a> subclass.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionToolButton.Version</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">1</td>
</tr>
</table>
<p>The version is used by <a href="qstyleoption.html">QStyleOption</a> subclasses to implement
extensions without breaking compatibility. If you use <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>(), you
normally do not need to check it.</p>
<p><b>See also</b> <a href="qstyleoptiontoolbutton.html#StyleOptionType-enum">StyleOptionType</a>.</p>


<h3 class="fn"><a name="ToolButtonFeature-enum" />QStyleOptionToolButton.ToolButtonFeature</h3><p>Describes the various features that a tool button can have.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionToolButton.None</tt></td>
<td class="topAlign"><tt>0x00</tt></td>
<td class="topAlign">A normal tool button.</td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionToolButton.Arrow</tt></td>
<td class="topAlign"><tt>0x01</tt></td>
<td class="topAlign">The tool button is an arrow.</td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionToolButton.Menu</tt></td>
<td class="topAlign"><tt>0x04</tt></td>
<td class="topAlign">The tool button has a menu.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QStyleOptionToolButton.PopupDelay</tt></td>
<td class="topAlign"><tt>0x08</tt></td>
<td class="topAlign">There is a delay to showing the menu.</td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionToolButton.HasMenu</tt></td>
<td class="topAlign"><tt>0x10</tt></td>
<td class="topAlign">The button has a popup menu.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QStyleOptionToolButton.MenuButtonPopup</tt></td>
<td class="topAlign"><tt>Menu</tt></td>
<td class="topAlign">The button should display an arrow to indicate
that a menu is present.</td>
</tr>
</table>
<p>The ToolButtonFeatures type is a typedef for <a href="qflags.html">QFlags</a>&lt;ToolButtonFeature&gt;. It stores an OR
combination of ToolButtonFeature values.</p>
<p><b>See also</b> <a href="qstyleoptiontoolbutton.html#features-var">features</a>, <a href="qtoolbutton.html#toolButtonStyle-prop">QToolButton.toolButtonStyle</a>(),
and <a href="qtoolbutton.html#popupMode-prop">QToolButton.popupMode</a>().</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QStyleOptionToolButton" />QStyleOptionToolButton.__init__ (<i>self</i>)</h3><p>Constructs a <a href="qstyleoptiontoolbutton.html">QStyleOptionToolButton</a>,
initializing the members variables to their default values.</p>


<h3 class="fn"><a name="QStyleOptionToolButton-2" />QStyleOptionToolButton.__init__ (<i>self</i>, <a href="qstyleoptiontoolbutton.html">QStyleOptionToolButton</a>&#160;<i>other</i>)</h3><p>Constructs a copy of the <i>other</i> style option.</p>
<hr /><h2>Member Documentation</h2><h3 class="fn"><a name="arrowType-var" /><a href="qt.html#ArrowType-enum">Qt.ArrowType</a> arrowType</h3><p>This variable holds the direction of the arrow for the tool
button.</p>
<p>This value is only used if <a href="qstyleoptiontoolbutton.html#features-var">features</a> includes
<a href="qstyleoptiontoolbutton.html#ToolButtonFeature-enum">Arrow</a>. The
default value is <a href="qt.html#ArrowType-enum">Qt.DownArrow</a>.</p>


<h3 class="fn"><a name="features-var" /><a href="qstyleoptiontoolbutton-toolbuttonfeatures.html">ToolButtonFeatures</a> features</h3><p>This variable holds an OR combination of the tool button's
features.</p>
<p>The default value is <a href="qstyleoptiontoolbutton.html#ToolButtonFeature-enum">None</a>.</p>
<p><b>See also</b> <a href="qstyleoptiontoolbutton.html#ToolButtonFeature-enum">ToolButtonFeature</a>.</p>


<h3 class="fn"><a name="font-var" /><a href="qfont.html">QFont</a> font</h3><p>This variable holds the font that is used for the text.</p>
<p>This value is only used if <a href="qstyleoptiontoolbutton.html#toolButtonStyle-var">toolButtonStyle</a>
is <a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonTextUnderIcon</a>,
<a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonTextBesideIcon</a>, or
<a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonTextOnly</a>.
By default, the application's default font is used.</p>


<h3 class="fn"><a name="icon-var" /><a href="qicon.html">QIcon</a> icon</h3><p>This variable holds the icon for the tool button.</p>
<p>The default value is an empty icon, i.e. an icon with neither a
pixmap nor a filename.</p>
<p><b>See also</b> <a href="qstyleoptiontoolbutton.html#iconSize-var">iconSize</a>.</p>


<h3 class="fn"><a name="iconSize-var" /><a href="qsize.html">QSize</a> iconSize</h3><p>This variable holds the size of the icon for the tool
button.</p>
<p>The default value is <a href="qsize.html">QSize</a>(-1, -1),
i.e. an invalid size.</p>


<h3 class="fn"><a name="pos-var" /><a href="qpoint.html">QPoint</a> pos</h3><p>This variable holds the position of the tool button.</p>
<p>The default value is a null point, i.e. (0, 0)</p>


<h3 class="fn"><a name="text-var" />QString text</h3><p>This variable holds the text of the tool button.</p>
<p>This value is only used if <a href="qstyleoptiontoolbutton.html#toolButtonStyle-var">toolButtonStyle</a>
is <a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonTextUnderIcon</a>,
<a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonTextBesideIcon</a>, or
<a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonTextOnly</a>.
The default value is an empty string.</p>


<h3 class="fn"><a name="toolButtonStyle-var" /><a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonStyle</a> toolButtonStyle</h3><p>This variable holds a Qt.ToolButtonStyle value describing the
appearance of the tool button.</p>
<p>The default value is <a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonIconOnly</a>.</p>
<p><b>See also</b> <a href="qtoolbutton.html#toolButtonStyle-prop">QToolButton.toolButtonStyle</a>().</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>